<?php
include_once("../modules/checkA.php");
include_once("../../config.php"); 
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'member'");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("detail-list-function.php"); 
?>
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <?php include 'modules/head.php'; ?>
</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>




<div id="content">
<h1> 学员列表 </h1>

    <div class="tips">
        <div>1.申请审核中的数据，可以再次编辑修改。</div>
        <div>2.编辑excel表，请从此处导出，excel表请保持学员名字和编号项对应不变。</div>
    </div>




<!-- 用$system_part .list_boxes来控制来到确认板块信息显示-->
<div class="list-box">

<div class="statistic">

<a class="layui-btn" href="statistic.php?nav-itemed=member">
统计信息
</a>

<a class="layui-btn" href="export-member-list.php" target="_blank">
    导出学员信息
</a>


<a class="layui-btn" href="../importexcel/import_add.php" target="_blank">
        导入信息（考试，结业，开班）
</a>

        <div class="term-select-function">
            <label class="layui-form-label">筛选：</label>
            <div class="layui-input-block">

                <?
                $department_list=select_lines_all_items($table_Prefix."department","nid desc","","0");
                $department=select_one_line_all_items($table_Prefix."department","nid = '".$trans_nid."'");
                ?>



                <select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">

                    <? if($department['name']){?>
                    <option> <? echo $department['name'];?> </option>
                    <?;}?>
                    <option value="detail-list.php?nav-itemed=<? echo $system_part ?>"> 全部 </option>
                    <?php
                    for ($i = 0; $i < count($department_list); $i++) {
                        ?>
                        <option value="detail-list.php?nid=<? echo $department_list[$i]['nid'] ?>&nav-itemed=<? echo $system_part ?>"> <? echo $department_list[$i]['name'];?> </option>
                        <?;}?>
                </select>
            </div>
        </div>


    </div>


<div class="list-boxes layui-form">

<!--学员可能在每个阶段都会更换教练。更换教练会带来什么影响？-->
<!--    还是直接查看考试进度的教练？-->
<!--    还是要新增一个班的教练？-->

<table class="layui-table">
  <colgroup>
    <col width="80">
    <col width="100">
	<col > 
	<col > 
	<col > 
	<col > 
	<col >
	<col >
	<col >
	<col >
	<col > 
	<col >
	<col width="550">

  </colgroup>
  <thead>
    <tr>
      <th>序号</th>
      <th>姓名</th>
      <th>编号</th>
      <th>报名日期</th>
      <th>驾照</th>
      <th>付款状态</th>
<!--      <th>收据</th>-->
<!--      <th>体检表</th>-->
      <th>电话</th>
      <th>网点</th>
      <th>介绍人</th>
<!--      <th>教练员</th>-->
      <th>信息状态</th>
      <th>考试进度</th>
      <th>学员状态</th>
      <th>操作</th>
    </tr> 
  </thead>
  <tbody>




	<?php  
	for ($i = 0; $i < $detailnum; $i++) {
    ?>


<!--//查看这条信息有无修改申请，有的话就变色，提示修改中-->
        <? $applymodify=select_one_line_all_items($table_Prefix."member","sid='".$detail[$i]['nid']."' and applystatus='申请修改'") ;?>


        <tr <?if($applymodify['nid']){echo "style='color:red'";$status="审核中";}else{$status="正常";}?>>
      <td><?echo $i+1+$plate['page_list_num']*($nowpageid-1) ?></td>
      <td><?echo $detail[$i]['name']?></td>
      <td><?echo $detail[$i]['mid']?></td>
      <td><?echo substr($detail[$i]['applydate'],0,10)?></td>
      <td><?echo $detail[$i]['license']?></td>
	  <td>
	  <span
	  <?if($detail[$i]['status']=="未付")
	  {
		  echo "style='background-color:#ff0000'";
      }?>
	  >
	  <?echo $detail[$i]['status']?></span></td>


<!---->
<!--	  <td>--><?//if($detail[$i]['receipt']=="已生成"){echo "已生成";}else{echo "<span style='color:red'>未生成<span></span>";} ?><!--</td>-->
<!---->
<!---->
<!---->
<!--        --><?// $count_healthform=count_by_item($table_Prefix."healthform","masterid='".$detail[$i]['nid']."'");?>
<!---->
<!--        <td>--><?//if($count_healthform>0){echo "已提交";}else{echo "<span style='color:red'>未提交<span></span>";} ?><!--</td>-->



        <td><?echo $detail[$i]['phone']?></td>
       <?$department=select_one_line_all_items($table_Prefix."department","nid = '".$detail[$i]['departmentid']."'");?>
       <?$agent=select_one_line_all_items($table_Prefix."employee","nid = '".$detail[$i]['agentid']."'");?>
       <?$coach=select_one_line_all_items($table_Prefix."employee","nid = '".$detail[$i]['coachid']."'");?>
	  <td><?echo $department['name'] ?></td>
	  <td><?echo $agent['name'] ?></td>
<!--	  <td>--><?//echo $coach['name'] ?><!--</td>-->
	  <td><?echo $status?></td>


            <? $exam=select_one_line_all_items($table_Prefix."exam","masterid = '".$detail[$i]['nid']."' order by nid desc")?>

            <td><?if($exam['name']){echo $exam['name'].",".$exam['status'];}?></td>
            <td> <?echo $detail[$i]['graduate']?> </td>
	  <td>





 <? if(!in_array("admin",$quanxian)){?>


<? if($applymodify['nid']){ ;?>
<a href="detail-edit.php?nav-itemed=<?echo $system_part?>&nid=<? echo $applymodify['nid']?>" class="layui-btn layui-btn-primary layui-btn-small" >
<i class="layui-icon">&#xe642;</i>修改
</a>
<?;}else{?>

<a href="detail-add-edit.php?nav-itemed=<?echo $system_part?>&nid=<? echo $detail[$i]['nid']?>" class="layui-btn layui-btn-primary layui-btn-small" >
<i class="layui-icon">&#xe642;</i>修改
  </a><?}?>



<?}else{?>
  <a href="detail-edit.php?nav-itemed=<?echo $system_part?>&nid=<? echo $detail[$i]['nid']?>" class="layui-btn layui-btn-primary layui-btn-small" >
    <i class="layui-icon">&#xe642;</i>修改
  </a>

<?}?>






<a href="detail-statistic.php?nav-itemed=<?echo $system_part?>&nid=<? echo $detail[$i]['nid']?>" class="layui-btn layui-btn-primary layui-btn-small" >信息</a>


<?if(($detail[$i]['status']=="已收款")&&($detail[$i]['receipt']=="未生成")){ ?>
<a href="../receipt/detail-add.php?nav-itemed=receipt&nid=<? echo $detail[$i]['nid']?>&type=xuefei" class="layui-btn layui-btn-primary layui-btn-small" target="_blank">生成收据</a>
<?}?>


<?if($count_healthform<=0){ ?>
<!--<a href="../healthform/detail-add.php?nav-itemed=member&nid=--><?// echo $detail[$i]['nid']?><!--" class="layui-btn layui-btn-primary layui-btn-small">体检表</a>-->
    <a href="../healthform/detail-print.php?nav-itemed=member&membernid=<? echo $detail[$i]['nid']?>" class="layui-btn layui-btn-primary layui-btn-small">体检表</a>
<? } ?>

<? $applymodify=count_by_item($table_Prefix."member","sid = '".$detail[$i]['nid']."' and applystatus = '申请修改'")?>


          <? if(in_array("admin",$quanxian)){?>
<a href="javascript:void(0)" onclick="popupBox(<?php echo $detail[$i]['nid']?>)" class="delete layui-btn layui-btn-primary layui-btn-small" > <i class="layui-icon">&#xe640;</i> 删除 </a>


<?if($applymodify){?>
<a href="detail-verify.php?nav-itemed=<?echo $system_part?>&nid=<? echo $detail[$i]['nid']?>" class="layui-btn layui-btn-primary layui-btn-small">审核</a>
<?}?>

<?}?>


  </td>
    </tr>
  <?php

}
?>

 
  </tbody>
</table>




 

</div>


<div class="list-box-function" <? if ($detailnum == 0) {
    echo "style" . "='display:none'";
} ?> >
    <div class="page-guide">

        <?php
        if ($nowpageid == 1) {
            ?>
            <!--现在页数在第一页的时候-->
            <span>首页</span>
            <span>前一页</span>
            <!--现在页数非第一页的时候-->
        <?php
        } else {
            ?>
            <!--现在页数非第一页的时候-->
            <a href="detail-list.php?sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&sys_part=<? echo $system_part ?>">首页</a>
            <a href="detail-list.php?nowpageid=<?php echo $prepage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&sys_part=<? echo $system_part ?>">前一页</a>
            <!--现在页数非第一页的时候-->
        <?php
        }
        ?>


        <!--开始列印出所有页码-->

        <?php
        $ii = 1;
        $iii = 1;

        while ($ii <= $page_count) {
            //首先判断是不是当前页

            if ($ii == $nowpageid) {
                echo "<span>" . $ii . "</span>";
            } else if ((($ii + 5) < $nowpageid) || (($ii - 5) > $nowpageid)) {
            } else {
                echo "<a href='";
                echo "detail-list.php?nowpageid=";
                echo $iii;
                echo "&sortby=";
                echo $sort_by;
                echo "&nid=";
                echo $trans_nid;
                echo "&sys_part=";
                echo $system_part;
                echo "'>";
                echo $iii;
                echo "</a>";
            }

            $ii++;
            $iii++;
        }
        ?>

        <!--列印出所有页码 结束-->


        <?php
        if ($nowpageid == $page_count) {
            ?>
            <!--现在页数在第一页的时候-->
            <span>后一页</span>
            <span>末页</span>
            <!--现在页数非第一页的时候-->
        <?php
        } else {
            ?>
            <!--现在页数非第一页的时候-->
            <a href="detail-list.php?nowpageid=<?php echo $nextpage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&sys_part=<? echo $system_part ?>">后一页</a>
            <a href="detail-list.php?nowpageid=<?php echo $lastpage; ?>&sortby=<?php echo $sort_by; ?>&nid=<?php echo $trans_nid ?>&sys_part=<? echo $system_part ?>">末页</a>
            <!--现在页数非第一页的时候-->
        <?php
        }
        ?>


    </div>
    <!--翻页代码结束-->
</div>


<!--list-box end-->
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>









<!--删除box-->
<?php include '../modules/deletebar.php'; ?>
<!--删除box end-->


<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?> </body>
</html>
